package com.cci.kangdao.service.impl;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import com.cci.kangdao.crmapi.CRMApiUtils;
import com.cci.kangdao.crmapi.CRMResponeEntity;
import com.cci.kangdao.service.WarrantyInfoService;
import com.cci.kangdao.utilTool.ParameterTool;
import com.cci.kangdao.utilTool.RequestContextHolder;

import net.sf.json.JSONObject;


@Service
public class WarrantyInfoServiceImpl implements WarrantyInfoService {

	@Override
	public void getWarrantyInfo(String orderNo) {
		HttpServletResponse response = RequestContextHolder.getResponse();
		CRMResponeEntity crmResult = CRMApiUtils.getCRMServiceApi().syncCRMWarrantyInfo(orderNo);
		
		
		JSONObject jObj = new JSONObject();
		jObj.put("status", crmResult.getStatus());
		jObj.put("msg", crmResult.getMessage());
		jObj.put("data", crmResult.getData());
		
		ParameterTool.writeResponse(response, jObj.toString());
	}
	
	
}
